<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Over The Air (OTA) Update Library: OTA Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="infineon_logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Over The Air (OTA) Update Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.7 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="modules.html"><span>API&#160;Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__ota__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">OTA Functions<div class="ingroups"><a class="el" href="group__group__cy__ota.html">Infineon Over The Air (OTA) API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>Functions to start/stop and query the OTA Agent. </p>
<p>OTA functions for starting, stopping, and getting information about the OTA Agent.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga05b1ce8823a81d534247afd43db4c536"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#ga05b1ce8823a81d534247afd43db4c536">cy_ota_agent_start</a> (<a class="el" href="structcy__ota__network__params__t.html">cy_ota_network_params_t</a> *network_params, <a class="el" href="structcy__ota__agent__params__t.html">cy_ota_agent_params_t</a> *agent_params, <a class="el" href="structcy__ota__storage__interface__t.html">cy_ota_storage_interface_t</a> *storage_interface, <a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> *ctx_ptr)</td></tr>
<tr class="memdesc:ga05b1ce8823a81d534247afd43db4c536"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start the OTA Background Agent.  <a href="#ga05b1ce8823a81d534247afd43db4c536">More...</a><br /></td></tr>
<tr class="separator:ga05b1ce8823a81d534247afd43db4c536"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafc2e0386db205ece6b355fa5dd91437a"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#gafc2e0386db205ece6b355fa5dd91437a">cy_ota_agent_stop</a> (<a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> *ctx_ptr)</td></tr>
<tr class="memdesc:gafc2e0386db205ece6b355fa5dd91437a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop OTA Background Agent.  <a href="#gafc2e0386db205ece6b355fa5dd91437a">More...</a><br /></td></tr>
<tr class="separator:gafc2e0386db205ece6b355fa5dd91437a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga06bc6c2f2eb7cb6f52f80ef16574fd1e"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#ga06bc6c2f2eb7cb6f52f80ef16574fd1e">cy_ota_get_update_now</a> (<a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> ctx_ptr)</td></tr>
<tr class="memdesc:ga06bc6c2f2eb7cb6f52f80ef16574fd1e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check for OTA update availability and download update now.  <a href="#ga06bc6c2f2eb7cb6f52f80ef16574fd1e">More...</a><br /></td></tr>
<tr class="separator:ga06bc6c2f2eb7cb6f52f80ef16574fd1e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga718197f84a569de2c074f3494508c952"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#ga718197f84a569de2c074f3494508c952">cy_ota_set_log_level</a> (CY_LOG_LEVEL_T level)</td></tr>
<tr class="memdesc:ga718197f84a569de2c074f3494508c952"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the OTA log output level.  <a href="#ga718197f84a569de2c074f3494508c952">More...</a><br /></td></tr>
<tr class="separator:ga718197f84a569de2c074f3494508c952"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae81a4c72366f5211751c1f0304295d40"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#gae81a4c72366f5211751c1f0304295d40">cy_ota_get_state</a> (<a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> ota_ptr, <a class="el" href="group__group__ota__typedefs.html#gab1539ebc23219f1ca64318286e9d375f">cy_ota_agent_state_t</a> *ota_state)</td></tr>
<tr class="memdesc:gae81a4c72366f5211751c1f0304295d40"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the OTA Agent State.  <a href="#gae81a4c72366f5211751c1f0304295d40">More...</a><br /></td></tr>
<tr class="separator:gae81a4c72366f5211751c1f0304295d40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7149423078fe0b9d401bddc1d0e808d1"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#ga7149423078fe0b9d401bddc1d0e808d1">cy_ota_get_last_error</a> (void)</td></tr>
<tr class="memdesc:ga7149423078fe0b9d401bddc1d0e808d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the last OTA error.  <a href="#ga7149423078fe0b9d401bddc1d0e808d1">More...</a><br /></td></tr>
<tr class="separator:ga7149423078fe0b9d401bddc1d0e808d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaffc74d5bb4dd74ede1031222b9efcd9b"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#gaffc74d5bb4dd74ede1031222b9efcd9b">cy_ota_get_error_string</a> (cy_rslt_t error)</td></tr>
<tr class="memdesc:gaffc74d5bb4dd74ede1031222b9efcd9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a string representation of the error.  <a href="#gaffc74d5bb4dd74ede1031222b9efcd9b">More...</a><br /></td></tr>
<tr class="separator:gaffc74d5bb4dd74ede1031222b9efcd9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafb857a3ac5167224f6f3af877a33ac32"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#gafb857a3ac5167224f6f3af877a33ac32">cy_ota_get_state_string</a> (<a class="el" href="group__group__ota__typedefs.html#gab1539ebc23219f1ca64318286e9d375f">cy_ota_agent_state_t</a> state_value)</td></tr>
<tr class="memdesc:gafb857a3ac5167224f6f3af877a33ac32"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a string Representation of the OTA state.  <a href="#gafb857a3ac5167224f6f3af877a33ac32">More...</a><br /></td></tr>
<tr class="separator:gafb857a3ac5167224f6f3af877a33ac32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1f3276614aeca5a8d7c176f171024d66"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#ga1f3276614aeca5a8d7c176f171024d66">cy_ota_get_callback_reason_string</a> (<a class="el" href="group__group__ota__typedefs.html#gad852fa8cdb0431df709ccf12bb37cd60">cy_ota_cb_reason_t</a> reason)</td></tr>
<tr class="memdesc:ga1f3276614aeca5a8d7c176f171024d66"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a string representation for the callback reason.  <a href="#ga1f3276614aeca5a8d7c176f171024d66">More...</a><br /></td></tr>
<tr class="separator:ga1f3276614aeca5a8d7c176f171024d66"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadcb046c596185d43e4d76202f2316c8d"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#gadcb046c596185d43e4d76202f2316c8d">cy_ota_ble_download_prepare</a> (<a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> ctx_ptr)</td></tr>
<tr class="memdesc:gadcb046c596185d43e4d76202f2316c8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prepare for Bluetooth® OTA Download.  <a href="#gadcb046c596185d43e4d76202f2316c8d">More...</a><br /></td></tr>
<tr class="separator:gadcb046c596185d43e4d76202f2316c8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3a694b9417c4875e1a6af4b03b861f56"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#ga3a694b9417c4875e1a6af4b03b861f56">cy_ota_ble_download</a> (<a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> ctx_ptr, uint32_t update_file_size)</td></tr>
<tr class="memdesc:ga3a694b9417c4875e1a6af4b03b861f56"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bluetooth® OTA Download starting.  <a href="#ga3a694b9417c4875e1a6af4b03b861f56">More...</a><br /></td></tr>
<tr class="separator:ga3a694b9417c4875e1a6af4b03b861f56"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0f43e3a4b81b23e5ce61d0ef7a0491f8"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#ga0f43e3a4b81b23e5ce61d0ef7a0491f8">cy_ota_ble_download_write</a> (<a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> ctx_ptr, uint8_t *data_buf, uint16_t len, uint16_t offset)</td></tr>
<tr class="memdesc:ga0f43e3a4b81b23e5ce61d0ef7a0491f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bluetooth® OTA data write.  <a href="#ga0f43e3a4b81b23e5ce61d0ef7a0491f8">More...</a><br /></td></tr>
<tr class="separator:ga0f43e3a4b81b23e5ce61d0ef7a0491f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2545802968d85f90a3ea1b9bd73e2fb0"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#ga2545802968d85f90a3ea1b9bd73e2fb0">cy_ota_ble_download_verify</a> (<a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> ctx_ptr, uint32_t update_file_crc, bool verify_crc_or_signature)</td></tr>
<tr class="memdesc:ga2545802968d85f90a3ea1b9bd73e2fb0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Bluetooth® OTA Verify download.  <a href="#ga2545802968d85f90a3ea1b9bd73e2fb0">More...</a><br /></td></tr>
<tr class="separator:ga2545802968d85f90a3ea1b9bd73e2fb0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac3dd727bc5a95099a0f6f3dbff52a977"><td class="memItemLeft" align="right" valign="top">cy_rslt_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ota__functions.html#gac3dd727bc5a95099a0f6f3dbff52a977">cy_ota_ble_download_abort</a> (<a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> ctx_ptr)</td></tr>
<tr class="memdesc:gac3dd727bc5a95099a0f6f3dbff52a977"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abort Bluetooth® OTA download.  <a href="#gac3dd727bc5a95099a0f6f3dbff52a977">More...</a><br /></td></tr>
<tr class="separator:gac3dd727bc5a95099a0f6f3dbff52a977"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga05b1ce8823a81d534247afd43db4c536"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_agent_start </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__ota__network__params__t.html">cy_ota_network_params_t</a> *&#160;</td>
          <td class="paramname"><em>network_params</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__ota__agent__params__t.html">cy_ota_agent_params_t</a> *&#160;</td>
          <td class="paramname"><em>agent_params</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__ota__storage__interface__t.html">cy_ota_storage_interface_t</a> *&#160;</td>
          <td class="paramname"><em>storage_interface</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> *&#160;</td>
          <td class="paramname"><em>ctx_ptr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start the OTA Background Agent. </p>
<p>Start a thread to monitor for OTA updates. This consumes resources until <a class="el" href="group__group__ota__functions.html#gafc2e0386db205ece6b355fa5dd91437a" title="Stop OTA Background Agent. ">cy_ota_agent_stop()</a> is called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">network_params</td><td>Pointer to <a class="el" href="structcy__ota__network__params__t.html" title="OTA Connection parameters structure. ">cy_ota_network_params_t</a>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">agent_params</td><td>Pointer to <a class="el" href="structcy__ota__agent__params__t.html" title="OTA Agent parameters structure. ">cy_ota_agent_params_t</a>. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">storage_interface</td><td>Pointer to <a class="el" href="structcy__ota__storage__interface__t.html" title="OTA storage interface callback APIs structure. ">cy_ota_storage_interface_t</a>. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">ctx_ptr</td><td>Handle to store the OTA Agent context structure pointer, Which is used for other OTA calls.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_BADARG CY_RSLT_OTA_ERROR_ALREADY_STARTED CY_RSLT_OTA_ERROR </dd></dl>

</div>
</div>
<a class="anchor" id="gafc2e0386db205ece6b355fa5dd91437a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_agent_stop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> *&#160;</td>
          <td class="paramname"><em>ctx_ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stop OTA Background Agent. </p>
<p>Stop the thread to monitor OTA updates and release resources.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ctx_ptr</td><td>Pointer to the OTA Agent context storage returned from <a class="el" href="group__group__ota__functions.html#ga05b1ce8823a81d534247afd43db4c536">cy_ota_agent_start()</a>;</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_BADARG </dd></dl>

</div>
</div>
<a class="anchor" id="ga06bc6c2f2eb7cb6f52f80ef16574fd1e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_get_update_now </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a>&#160;</td>
          <td class="paramname"><em>ctx_ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check for OTA update availability and download update now. </p>
<p>Once cy_ota_start() has returned CY_RSLT_SUCCESS, you can initiate an OTA update availability check whenever you require; this supercedes the timing values. It does not change the timer values, and will set the timer to the current values after an OTA download cycle.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ctx_ptr</td><td>Pointer to the OTA Agent context storage returned from <a class="el" href="group__group__ota__functions.html#ga05b1ce8823a81d534247afd43db4c536">cy_ota_agent_start()</a>;</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_BADARG CY_RSLT_OTA_ERROR_ALREADY_STARTED </dd></dl>

</div>
</div>
<a class="anchor" id="ga718197f84a569de2c074f3494508c952"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cy_ota_set_log_level </td>
          <td>(</td>
          <td class="paramtype">CY_LOG_LEVEL_T&#160;</td>
          <td class="paramname"><em>level</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the OTA log output level. </p>
<p>To get the OTA log output, first call cy_log_init(). Call this routine at any time to set the OTA logging level.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">level</td><td>Required logging level from OTA logs.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>N/A </dd></dl>

</div>
</div>
<a class="anchor" id="gae81a4c72366f5211751c1f0304295d40"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_get_state </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a>&#160;</td>
          <td class="paramname"><em>ota_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#gab1539ebc23219f1ca64318286e9d375f">cy_ota_agent_state_t</a> *&#160;</td>
          <td class="paramname"><em>ota_state</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the OTA Agent State. </p>
<p>Use this function to determine what state the OTA Agent is in. Do not check if the OTA Agent is in CY_OTA_STATE_AGENT_WAITING because it will interrupt an OTA cycle.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ota_ptr</td><td>Pointer to the OTA Agent context returned from <a class="el" href="group__group__ota__functions.html#ga05b1ce8823a81d534247afd43db4c536">cy_ota_agent_start()</a>; </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">ota_state</td><td>Current OTA State.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS sets <a class="el" href="group__group__ota__typedefs.html#gab1539ebc23219f1ca64318286e9d375f">cy_ota_agent_state_t</a> CY_RSLT_OTA_ERROR_GENERAL </dd></dl>

</div>
</div>
<a class="anchor" id="ga7149423078fe0b9d401bddc1d0e808d1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_get_last_error </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the last OTA error. </p>
<p>The last error value is persistent, and can be queried after <a class="el" href="group__group__ota__functions.html#gafc2e0386db205ece6b355fa5dd91437a">cy_ota_agent_stop()</a>.</p>
<dl class="section return"><dt>Returns</dt><dd>the last error that occurred (see cy_rslt_t). </dd></dl>

</div>
</div>
<a class="anchor" id="gaffc74d5bb4dd74ede1031222b9efcd9b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* cy_ota_get_error_string </td>
          <td>(</td>
          <td class="paramtype">cy_rslt_t&#160;</td>
          <td class="paramname"><em>error</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get a string representation of the error. </p>
<p>This can be called at any time.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">error</td><td>Value returned from <a class="el" href="group__group__ota__functions.html#ga7149423078fe0b9d401bddc1d0e808d1" title="Get the last OTA error. ">cy_ota_get_last_error()</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer to a string (NULL for unknown error). </dd></dl>

</div>
</div>
<a class="anchor" id="gafb857a3ac5167224f6f3af877a33ac32"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* cy_ota_get_state_string </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#gab1539ebc23219f1ca64318286e9d375f">cy_ota_agent_state_t</a>&#160;</td>
          <td class="paramname"><em>state_value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get a string Representation of the OTA state. </p>
<p>This can be called at any time.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">state_value</td><td><a class="el" href="group__group__ota__typedefs.html#gab1539ebc23219f1ca64318286e9d375f">cy_ota_agent_state_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer to the string (NULL for unknown state). </dd></dl>

</div>
</div>
<a class="anchor" id="ga1f3276614aeca5a8d7c176f171024d66"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const char* cy_ota_get_callback_reason_string </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#gad852fa8cdb0431df709ccf12bb37cd60">cy_ota_cb_reason_t</a>&#160;</td>
          <td class="paramname"><em>reason</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get a string representation for the callback reason. </p>
<p>This can be called at any time.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">reason</td><td><a class="el" href="group__group__ota__typedefs.html#gad852fa8cdb0431df709ccf12bb37cd60">cy_ota_cb_reason_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer to the string (NULL for unknown reason). </dd></dl>

</div>
</div>
<a class="anchor" id="gadcb046c596185d43e4d76202f2316c8d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_ble_download_prepare </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a>&#160;</td>
          <td class="paramname"><em>ctx_ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Prepare for Bluetooth® OTA Download. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ctx_ptr</td><td>Pointer to OTA agent context <a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_BLE_STORAGE </dd></dl>

</div>
</div>
<a class="anchor" id="ga3a694b9417c4875e1a6af4b03b861f56"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_ble_download </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a>&#160;</td>
          <td class="paramname"><em>ctx_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>update_file_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bluetooth® OTA Download starting. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ctx_ptr</td><td>Pointer to OTA agent context <a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">update_file_size</td><td>OTA update file size.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_BLE_STORAGE </dd></dl>

</div>
</div>
<a class="anchor" id="ga0f43e3a4b81b23e5ce61d0ef7a0491f8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_ble_download_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a>&#160;</td>
          <td class="paramname"><em>ctx_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data_buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>offset</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bluetooth® OTA data write. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ctx_ptr</td><td>Pointer to OTA agent context <a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data_buf</td><td>Pointer to data buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">len</td><td>Data length. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>Data buffer offset.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_BLE_STORAGE </dd></dl>

</div>
</div>
<a class="anchor" id="ga2545802968d85f90a3ea1b9bd73e2fb0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_ble_download_verify </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a>&#160;</td>
          <td class="paramname"><em>ctx_ptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>update_file_crc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>verify_crc_or_signature</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Bluetooth® OTA Verify download. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ctx_ptr</td><td>Pointer to OTA agent context <a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">update_file_crc</td><td>32 Bit CRC sent from the Host. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">verify_crc_or_signature</td><td>OTA library need to verify CRC.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS CY_RSLT_OTA_ERROR_BLE_VERIFY </dd></dl>

</div>
</div>
<a class="anchor" id="gac3dd727bc5a95099a0f6f3dbff52a977"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">cy_rslt_t cy_ota_ble_download_abort </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a>&#160;</td>
          <td class="paramname"><em>ctx_ptr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Abort Bluetooth® OTA download. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">ctx_ptr</td><td>Pointer to OTA agent context <a class="el" href="group__group__ota__typedefs.html#ga50b8b1ec191a1d5f9a8fcd3472811694">cy_ota_context_ptr</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_RSLT_SUCCESS </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Over The Air (OTA) Update Library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
</body>
</html>
